#!/usr/bin/python

from pygame import Rect
import pygame as p
from Load import Load

def rectMove(fromx:Rect,to:Rect)->tuple:
    if fromx.width!=to.width or fromx.height!=to.height:raise ValueError('two Rect\'s size are not the same')
    return (to.left-fromx.left,to.top-fromx.top)
def convertMainRect(target:list,goal:Rect)->list:
    buttons=list()
    for i in target:
        cache=goal
        cache.center=i
        buttons.append(cache)
    return buttons
def showTextBar(text:str,data:Load)->p.Surface:
    black=data.color['text_black']
    rv=data.comment_font.render(text=text,antialias=True,color=(black[0],black[1],black[2]))
    return rv
def showButtons(text:tuple,data:Load)->list:
    rv:list
    for i in text:
        rv1=showTextBar(text=i,data=data)
        rv2=rv1.get_rect()
        rv3=(rv1,rv2)
        rv.add(rv3)
    return rv